refactored min height/width code into its own class