Added a few comments + minor refactoring