Clean up a little bit the code