Major refactor on MainActivity