ruby: Refactor 001,002