encapsulated ActivityMain functionality