Some refactoring where the limits are put into it's own sub routine