restructuring code to kinda match ontology