rewritten autowiring + docs + added tests