common method to time blocks
various improvements, code cleaning, added default values for columns