Avoid duplicated code in helpers