formatting datas before interacting with database