More updates, refactorings and some comments.