refactor; documentation