Fix output on mobile device, minor optimization