Cleanup + add some comments

Signed-off-by: Piotr Bocheński <bochenski.piotr@gmail.com>