Add tests, have code and update checks in one place