spec pattern implementation