Moved logic from template for easier writing of custom ones.
Made tests more verbose (needed after moving logic + helps to find more bugs).