Add run time dependencies
Refactor the code