changed structure -- code moved to __init__

Signed-off-by: Adrian Matejov <a.matejov@centrum.sk>