blog logic and templates