Functionality for main activities