Cleaner solution for bound determination, less duplicate code