Changes to refactor code