hopefully last refactor