APM redo and smali clean up