Some tweaks in parser
Some functions to apply logic to category.