Simplified code and put module in