refactored to proper maven structure and fixed some smaller bugs