Minor refactor & improved test coverage