working on method factory