refactoring + bit of clean-up/renaming