refactored files into util and tests folders