#update - refactor code