Code refactor1