Inline some functions, precompile regex