Full rewrite - no framework