Logging improved.
Some methods put into separate files.