Fixed dependency issue
Improves on code