refactored body.classList to a function