Working tests and some improved style