Fix Deprecated and Notice error
refacto interface vs inheritance