Cleaned up code more