FIX: Cleaned up the code