Nesting classes to remove duplication