Improved Test Coverage and Refactors

Improves test coverage, along with cleanup and refactors.

:chart_with_upwards_trend: