- removed early return
- removed duplicate code