10 and 20 seem like significant numbers here that appear in other functions as well -- maybe we should extract them out into named constants at the top level?