Improve regex and key