Refactor

Just doing some cleanup. Couldn't get the selenium tests to run but everything else passes.