build main layout