First part BugFix @ Refactor because of updated scala version