modularised code and added activity browsing