Some refactoring..

Signed-off-by: Alexander Book <redchrome@gmx.de>