change almost all !=nil and !empty conditions to not nil? and not empty?.