refactored mobiled js