Organising files into corresponding directories