Cleaned up sample controller