Removed duplication in test class