refactor code to using reference