abstracting classes and initing layout