improve structure to prepare for extensions