Perform little optimizations to the code