refactoring; WIP