refactored build() and helpers, logged null case