reorganisation of code