added onReady, added custom event log method, tweaks &  optimizations