Mainly style adjustments for new optimized implementation