refactoring for better structure and convention based test support