refactoring pad function and removing DDD format