new structure of analysis. This is now working with JDBC
fixing some bug. clean code