Feat/extract cleanup methods

Extracted cleanup methods to own file `cleanup.rb`