More modularizing and security enhancements