Refactored database. Included Timestamp for actions