Almost ready, some logic for checking insert/update remain only