Improve Merge #2767

removed legacy code and applied code standards