refactoring to prepare for restructure