Refactored files

Reworking extension for more type-safing