improve to allow custom service