extract utility method