more refactoring in lead up to database entries