[Problem003] refactor