lots of refactorings/playing with ideas