polish the code