core - cleaning code