Extracted get_layout method
Rubocop style issues