externalize some inner classes for readability of the source