Cleaned up appWebSql to make it more readable and coherent