Reorganisation, removed some coding style warnings