Refactor to have a better solution of painter override.