delete redundant code and achieved 90% coverage