Tidying up table loading code and regexps