refactored with move method