fix code style issues; isolate code for mobile; change native logging