doc blocks and code cleanup