[Template] refactored everything, uses templates now, basically works still needs some tweaks and then tests