javascript refactoring
neverending js refactoring