Refactor implemented