Cleaned up application functions