Cleaned up modal controller