Scratchbox optimization