Simplified the code.