refactoring and placing boundaries