some global utility functions
added Lifetime system and all its stuff