Some refactorings on views edit and new