new code refactor