Useful code draft need re-organized