cleaned up code so dont need extra test for code coverage