cleaned up code-structure a bit
cleaned up code-structure a bit