added layout rendering
refactoring