Refactoring of Code

Syncing seemed to fail on me.