-- removed unused stuff
-- minor refactorings to improve codequality