Refactored and fixed typos
Added support for activities