Refactor tests for processing and adapt it to new library structure, plus fix unit tests for processing