code refactor.