Refactor the code

#12
by loubnabnl HF staff - opened