Making better the code