remove duplication in tests and added sanity test