Cleanup, remove some unused variables
Cleanup
Far nicer, rather than inline regex