Let implemented reorganised some code