Moved script for UI into separate file