add changes from code review with Matthijs