refactoring the view layouts