view adding refactor