Abstract out getServices function