Improves layout and refactors tests.