Refactor for simple functional usage