better regexp and mapping