Refactoring to avoid race conditions/npes because of un-created properties