removed di and used magic methods