refactoring in formViewController