major refactoring for better integration in eclipse
plugin only works correctly with eclipse plugin