refactoring WIP2