local data variable and some code style fixation