Refractoring and new functions