Factor out in some utils file