remove warnings and clean legacy code
remove warnings and legacy code