Extract adapter and refactor MainActivity