Refactored some links, added foreign_key