remove unnecessary early return and fix documentation