Custom templates implementation. Later this mechanism would be changed.