finished moving mappings into Pattern class