remove duplication in service class