refactor problem005