Removed duplicate code, and introduce support for all keyword.