Fix a small bug and refine code