refactoring: externlized innerclasses