switching to using a pattern