added todos
added todo
refactored the logic for browser vs compiled versions