Refactor preparing source dir