Modularize this in a static api?