lots of refactoring...