Molecular mechanisms of amyloid-like fibril formation