refactoring kvviewcontroller