add configuration support
remove nnecessary 'else' block
remove nnecessary 'else' block
check length of original string longer than expected padding length