more code refractoring