refactoring done
slight modification in view
second refactoring complete