acm1 template + minor refactoring