refactoring complete and indentation addressed