some small code cleanups

just a quick cleanup of primitives, eliminate some extra assignments and else's