Code refactoring + XP_DEBT moved to DB.