added karma coverage
refactored some scripts to handle cleaning syntax