code reorg; auto screen size adjust