Clean up code, works with 2.3.3