Improve a bit the code