completely revised architecture
added support for API 8