refactor --all unit tests passing