Add pencilmarks, minor refactorings and shortcut re-allocations