Refactor Main View