re-architect to support multiple platforms