factory method pattern init
fix build error
new/delete leakage fix
remove unnecessary definition