some up-to-the-dates. splitted main into some functions