Updated grail layout. Refactored. Added helper scripts.