code refactor and declare dependencies as optional, except slick