refactoring our app