refactoring and working on new layout