Revert "direct return gave me `nil pointer dereference` error"

This reverts commit 71de93e4fb43b7fdf54ba5bdcfbd8618c6c16cad.
Revert "refactoring"

This reverts commit af8693526057f65fc0454f76bc84e87d5a7670dd.