Added test coverage and removed commented code