Increase cache size by golden ratio

Also simplify replicated code