Move closure into regular class