Refactor code to use Property