Replace multiple if checks with regex
Fix comment