* replaced if statement with ternary operators
* overrides active template
* minor refactoring