moved sqls and prepared statement indexes to defines