Refactor of view-related things