minor changes in implementations of dss functions for readability and debugability