Improve and document comment handling