starting to finish up refactor that became bigger than anticipated...