Refactor entity, add listner and improve in functionality