optimize space usage