refactor with salat and casbah