cleanup and moving vars around

Signed-off-by: Matthias Rohrbach <m.rohrbach@robandrose.ch>