* Organizes imports
* Adds more test code in Code tab
* Moves preview logic to function