encapsulated functionality in ActivityMain