Code tidy up, clean some warning reported by IDE