NXDRIVE-74: Clean up code + pep8 warnings + comments