clean up some syntax
fix improve regexp to avoid repeating pattern