[sw] extrace layout and main controller