After refactoring - using plugin hooks