Separated into base classes, fixed regex.