fix minor issue and tidy