minore code cleanup + commenting