committing partial refactor to dev branch