refactored code

moved all logic into shortner constraints class