refactoring views with extract method pattern