Reorganization of files

And small functional improvements