refactor (better cope with arch and dependencies)