refctoring layout
almost perfect version at this moment