Code restructure and build issue fixed