Some cleanup

Far less repetitive calls to the location object and regex methods. Also makes things easier to read through.