some last minute design changes, now the code looks like shit :)