JsDocs and little code cleanup