refactored to consume adapterfactory and some code simplification
accepting objects