Added check for state property in StateUtils
Removed legacy code and converted expressions from XML to String