added timeout to chain validation, changed file structure