Simply code refactor