Fixed last ToDo; added proper exceptions handling; added proper logging;
added method descriptions.
Not tested at all.