minor refactoring, hopeful step closer to image serving
about to convert for image serving