rewrite get properties code