Replaced closures in factories and created interfaces