Start to refactor to make it more generic (not limited to just image cropping).