use inline object/if + misc cleanups