Some coding improvement