Trying to separate nicely the code