Add USE_DJ_STATIC as setting in dev
Refactor some code