change Source module to class and add repeat code into method
change module Source to class Source
remove same repeated code in each file to use method in lib/source.rb
lockfile will be nil if file doesn't exist