finish up large refactor