Fix regression for link to posts
More refactoring