Refactored stuff out of onCreate