Refactor set if not null calls