refactored code to remove pattern because it wasn't needed.