html elements factory through a service