some cleanup, feel free to put your changes in pawel, wouldn't recommend git merging though