Start refactoring routine generator

The routine generator should be more flexible and be able to calculate
weights based on the user's past performance