Refactor to simply tests and stop copy+pasted code