Tab support ongoing, code a little less fugly