Refactor constraint application

Improve consistency and readability
Move weight calculation to integration step