code review, fixes #383