refactoring - deleting a load of methods and generating them dynamically