move initTable out of controller