fix active classes and clean code