clean up and refactor; add in config loading