Optimizes code