some refactoring, improving

Signed-off-by: Christian Lüthold <biocodr@gmail.com>