We should modularize the code.