cleanup, refactoring, and redundancy