continue refactoring
add table to tests
add test for index