Code restructure 2