Splitting code into a standalone and web version