re-organize source-code
add new feature that change layout: vertical <-> horizontal