bugfix/code cleanup