Refactor generator checks to occur in function declaration end