Move blocktime to own function