added first version of proper file management: using sqlite because at the end of the day this seams to be the cleanest way.