refs #9 first part of refactoring