Add some comments + fix some code smells.