1) Some refactoring (still incomplete)
2) New subs processing