Cleaned up a bit sw code