Refactor create view