refactor for wefarm tutorial