Added support for custom layouts
Code inspection fixes