extract content-processing into separate file, make tool for building links