Removed some indirections, refactored startup