Modify timestamp function and make logger function smaller