remove unused files
simpler way to declare functions
fix trimSummary() regex to handle newlines