Splitting code into several classes for better code handling.
Added cache function to only update changed files.