:8969973 Yeah. This is something I hate sometimes. (I avoid as much as possible writing output in my application logic.) But I don't never really know how it's the best to pass the variables to templates (No, I don't mean smarty like etc., but code with small PHP language constructs and full with ) Shall I create an array and then extract it? Shall I directly access the array instead of extracting etc. I never know how I will be okay with... Storage logic should be in my opinion some magic setter and getter which stores the data in some object that's being passed around through the whole code and decides if the data has to be saved into database by using a few callbacks. If you have simple variables here and there and do in some place a query for updating, you will result in often querying the database even if you've already read the data in some place.