Refactor code, prepare croping