Some code cleanup

This patch cleans up some code like replacing deprecated method calls or removing logic related to WO < 5.4.3