modified and cleaned boilerplate template