refactror tests