Move word logic to backend

Signed-off-by: Jack Yen <jack@jackyen.com>