semi modularized code