Event loop, lifecycle callback and variable naming consistency refactor.