Some refactoring; fixed timestamp issue