Optimize query simplicty by using Prepared Statments