Small space optimization