Adds tests and refactors