Initial work to refactor