Clean code
Add tests and clean code