Mainly constant time improvements