Code cleanup, reduced object allocations