Refactor creating sandbox
Fix determining constraints with sandbox sources present