Refactor sources parser