Functional additions and structure cleanup