refactoring - in progress