refactoring status JS - shorter+introspection of data type