Updating to use a template and stuff