Refactor bin and lib folders