Improved module implementation