Extract composition into a method that uses $.extend