Move generalisation to new package
Put general algorithm in a separate package