Clean code and set testing infrastructure