Removed StateModel and converted to using listener approach