updated tests and wraped implementation in an object