Improved keyword handling