refactored javascript with anonymous functions and file-only scope