refactor to reduce number of dependencies