Refactor 1st phase