update: code refactoring