complete refactoring based off realworld usage