turn everything except the base functionality that sets things up into functions
consistency fixes