Change default queue limit to 900, rearrange some functions for
readability