Refactor tests
Fix #4