code refactoring update