refactor for readability, and fix bug catching "return" instead of "@return"