better test coverage and removed unnecessary code