some minor refactor, preparing for menu system