Refactored DOM manipulation to ng show and ng class