Cleaner code, with updates to main activity