minor refactoring on $.control