Error caused due to bad refactoring