Major refactoring and mobile adaption