reorganize and get tests working