Initial commit
Factor out utility functions