Refactored code and implemented methods for custom keyword injection inside generated views