add a register method to register bean easily