Database connection exceptions handling was added.
Unused code was removed.
Transactions were added to "main.init".