refactor. add some tests but not implemented yet