try to improve my code to a brief one!