Cleaning up code + basic hierarchy formatting