code refactor 1