moved code to function getStateFromProperties