Shrink code 35%! And added test page.