more tests passing, more code cleanup