topic 2.  and topic1 refactored