rm not needed resource
function improvement