Some code cleanup. Please test the dev build!