decoupling & moving forward with getting rid of magic, introduced Error class