amd/jquery factory pattern