Implement checks and improve repository handling