refactoring in preperation for color