refactoring / bug fixing

Signed-off-by: scottsavarie@gmail.com <158brunnenstrasse>