refactoring and split tests into multuple files