Slight code size and speed optimization