Cleaner version, made classed and headers